package item;

import static javax.persistence.GenerationType.SEQUENCE;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Version;

import org.omg.CosNaming.IstringHelper;


public class itsUsers {
	
	
	private long id;
	
	private long version;
	
	private String username;
	private String usermail;
	private String userrole;
	private String passw;
	
	public void setDatosUser(String name, String mail, String apassw){
		username = name;
		usermail = mail;
		passw = apassw;	
	}
	
	public void setRoleUser(String role){
		userrole = role;
	}
	

	public long getId(){
		return this.id;
	}
	public void setId(long id){
		this.id = id;
	}
	
	public String getUsername(){
		return this.username;
	}
	
	public String getRole(){
		return this.userrole;
	}
	
	public itsUsersMemento crearMemento(){
		itsUsersMemento m = new itsUsersMemento(this.id,this.version,this.username,this.passw,this.usermail,this.userrole);
		return m;
	}
	public void restaurarMemento(itsUsersMemento m){
		this.id = m.getId();
		this.version = m.getVersion();
		this.username = m.getUsername();
		this.passw = m.getPassw();
		this.usermail = m.getUsermail();
		this.userrole = m.getUserrole();
	}
}
